home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
comm
/
comm2
/
scrtch11.lha
/
ScratchE!
< prev
next >
Wrap
Text File
|
1996-11-09
|
14KB
|
498 lines
/*************************************************************************/
/* ScratchE! v1.1 by Morpheus (robin@te.xs4all.nl) */
/*************************************************************************/
options results
/*************************************************************************/
/* chance : the chance to win a game */
/* gain : the gain-factor */
/*************************************************************************/
chance=5
gain=3
/********************************* Script ********************************/
bbsidentify name
bbsname=result
bbsidentify term
maxlines=word(result,2)
if maxlines<30 then setlength 30
getuser 7
starttijd=result
getuser 42
startbyte=result
getuser 43
startfile=result
sp1=' '
sp2=' '
b.1='
ÉÍÍ ÍÍ»'
b.2='º'
b.3=' '
b.4='º'
b.5='ÈÍÍ Íͼ'
s.1.1='
'
s.1.2='
1 '
s.1.3='
'
s.2.1='
'
s.2.2='
2 2 '
s.2.3='
'
s.3.1='
3 '
s.3.2='
3 '
s.3.3='
3 '
s.4.1='
4 4 '
s.4.2='
'
s.4.3='
4 4 '
s.5.1='
5 5 '
s.5.2='
5 '
s.5.3='
5 5 '
s.6.1='
6 6 6 '
s.6.2='
'
s.6.3='
6 6 6 '
right=50;left=22;top=10;bot=16
call instr
call changegame
quit=0
cg=0
do while quit=0
call init_lot
call draw_lot
call place_bet
if cg=0 then;do
sendstring apos(29,35)||'\k1S C R A T C H\k0'
call get_input
call win_or_lose
end
else cg=0
end
call exitscratche
init_lot:
win=0
i=rnd(chance)
if i=0 then
do
do j=1 for 6
sym.j=0
end
win=1
winsym=rnd(6)+1
j=1
do while j~=4
k=rnd(6)+1
if sym.k=0 then;do
sym.k=winsym
j=j+1
end
end
do j=1 for 6
if sym.j=0 then;do
k=rnd(6)+1
sym.j=k
end
end
end
else
do
tst='0000000000000000'
j=1
do while j~=7
i=rnd(12)+1
if substr(tst,i,1)='0' then
do
tst=overlay('1',tst,i)
if i>6 then i=i-6
sym.j=i
j=j+1
end
end
end
return
draw_lot:
sendstring '\f1\@6\c4\n1'
sendstring center('ÚÄÄÄÄÄ¿ÚÄÄÄÄÄ¿ÚÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄ¿ÚÄÄÄÄÄ¿ÚÄÄÄÄÄ¿ÚÄ¿ ÚÄ¿ÚÄÄÄÄÄ¿ÚÄ¿',80)||'\n1'
sendstring center('³ÿÚÄÄÄÙ³ÿÚÄ¿ÿ³³ÿÚÄÄ¿ÿ³³ÿÚÄÄ¿ÿ³ÀÄ¿ÿÚÄÙ³ÿÚÄ¿ÿ³³ÿ³ ³ÿ³³ÿÚÄÄÄÙ³ÿ³',80)||'\n1'
sendstring center('³ÿÀÄÄÄ¿³ÿ³ ÀÄÙ³ÿÀÄÄÙÿ³³ÿÀÄÄÙÿ³ ³ÿ³ ³ÿ³ ÀÄÙ³ÿÀÄÙÿ³³ÿÀÄ¿ ³ÿ³',80)||'\n1'
sendstring center('ÀÄÄÄ¿ÿ³³ÿ³ ÚÄ¿³ÿÚÄ¿ÿÚÙ³ÿÚÄÄ¿ÿ³ ³ÿ³ ³ÿ³ ÚÄ¿³ÿÚÄ¿ÿ³³ÿÚÄÙ ÀÄÙ',80)||'\n1'
sendstring center('ÚÄÄÄÙÿ³³ÿÀÄÙÿ³³ÿ³ ³ÿÀ¿³ÿ³ ³ÿ³ ³ÿ³ ³ÿÀÄÙÿ³³ÿ³ ³ÿ³³ÿÀÄÄÄ¿ÚÄ¿',80)||'\n1'
sendstring center('ÀÄÄÄÄÄÙÀÄÄÄÄÄÙÀÄÙ ÀÄÄÙÀÄÙ ÀÄÙ ÀÄÙ ÀÄÄÄÄÄÙÀÄÙ ÀÄÙÀÄÄÄÄÄÙÀÄÙ',80)||'\n1'
sendstring apos(9,20)||'
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍ»'
sendstring apos(10,20)||'º º º º'
sendstring apos(11,20)||'º º º º'
sendstring apos(12,20)||'º º º º'
sendstring apos(13,20)||'º º º º'
sendstring apos(14,20)||'º º º º'
sendstring apos(15,20)||'ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍ͹'
sendstring apos(16,20)||'º º º º'
sendstring apos(17,20)||'º º º º'
sendstring apos(18,20)||'º º º º'
sendstring apos(19,20)||'º º º º'
sendstring apos(20,20)||'º º º º'
sendstring apos(21,20)||'ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍͼ'
sendstring apos(11,5)||'\c6WRITTEN BY'
sendstring apos(13,6)||'MORPHEUS'
select
when gametype='1' then;do
typetext=' EXTRA TIME'
getuser 7
lefttext='Time left: '||result||' min.'
end
when gametype='2' then;do
typetext=' EXTRA BYTES'
getuser 42
lefttext='Bytes left: '||result||' credits'
end
when gametype='3' then;do
typetext=' EXTRA FILES'
getuser 43
lefttext='Files left: '||result||' credits'
end
when gametype='4' then typetext=' FUN!'
end
if gametype~='4' then sendstring apos(22,0)||'\c6'||center(lefttext,81)
sendstring apos(11,69)||'\6 PLAY FOR'||apos(13,66)||typetext
sendstring apos(24,5)||'\c4[\c3Q\c4]\c3 = QUIT \c4[\c3ENTER\c4]\c3 = SCRATCH \c4[\c3C\c4]\c3 = CHANGE GAME CURSORKEYS TO SELECT'
return
place_bet:
call check_carrier
select
when gametype='1' then;do forever
sendstring apos(26,26)||'\c6Place your bet \c1[\c60-15 min.\c1]\c6 :\c7 1 '||apos(26,55)
prompt 2
inzet=upper(result)
if inzet='Q' then call exitscratche
if inzet='C' then;do
cg=1
call changegame
return
end
if inzet='' then;do
inzet=1
sendstring apos(26,55)||'\c11'
end
if inzet>=0&inzet<16 then;do
getuser 7
if result>inzet then return
end
end
when gametype='2' then;do forever
sendstring apos(26,23)||'\c6Place your bet \c1[\c60-250 byte cr.\c1]\c6 :\c7 1 '||apos(26,57)
prompt 3
inzet=upper(result)
if inzet='Q' then call exitscratche
if inzet='C' then;do
cg=1
call changegame
return
end
if inzet='' then;do
inzet=1
sendstring apos(26,57)||'\c11'
end
if inzet>=0&inzet<251 then;do
getuser 42
if result>inzet then return
end
end
when gametype='3' then;do forever
sendstring apos(26,24)||'\c6Place your bet \c1[\c60-10 file cr.\c1]\c6 :\c7 1 '||apos(26,57)
prompt 2
inzet=upper(result)
if inzet='Q' then call exitscratche
if inzet='C' then;do
cg=1
call changegame
return
end
if inzet='' then;do
inzet=1
sendstring apos(26,57)||'\c11'
end
if inzet>=0&inzet<11 then;do
getuser 43
if result>inzet then return
end
end
otherwise nop
end
return
get_input:
x=22;y=10
sendstring apos(y,x)||b.1||apos(y+1,x)||b.2||apos(y+2,x)||b.3||apos(y+3,x)||b.4||apos(y+4,x)||b.5
sendstring apos(24,79)
einde=0
chang=0
niets=0
tel=0
do k=1 for 6
vak.k=0
end
k=1
do forever
call check_carrier
getchar
key=result
if key='1B'x then;do
checkio
if result='TRUE' then;do
getchar;getchar
key=result
if key='A' then key='8'
if key='B' then key='2'
if key='C' then key='6'
if key='D' then key='4'
end
else quit=1
end
else if key='D'x|key='5'|key=' ' then key='0'
oldx=x
oldy=y
select
when upper(key)='Q' then quit=1
when upper(key)='C' then;do
call changegame
chang=1
sendstring apos(24,79)
return
end
when key='2'&y<bot then y=y+6
when key='4'&x>left then x=x-14
when key='6'&x<right then x=x+14
when key='8'&y>top then y=y-6
when key='0' then;do
niets=1
i=sym.k
if vak.k=0 then tel=tel+1
vak.k=sym.k
sendstring apos(y+1,x+1)||s.i.1||apos(y+2,x+1)||s.i.2||apos(y+3,x+1)||s.i.3
sendstring apos(24,79)
end
otherwise niets=1
end
oldk=k
select
when x=22&y=10 then k=1
when x=22&y=16 then k=2
when x=36&y=10 then k=3
when x=36&y=16 then k=4
when x=50&y=10 then k=5
when x=50&y=16 then k=6
end
if niets=0&quit=0 then;do
if vak.oldk=0 then
sendstring '
'||apos(oldy,oldx)||sp1||apos(oldy+1,oldx)||sp1||apos(oldy+2,oldx)||sp1||apos(oldy+3,oldx)||sp1||apos(oldy+4,oldx)||sp1
else;do
i=vak.oldk
sendstring '
'||apos(oldy,oldx)||sp1||apos(oldy+1,oldx)||' '||s.i.1||'
'||apos(oldy+2,oldx)||' '||s.i.2||'
'||apos(oldy+3,oldx)||' '||s.i.3||'
'||apos(oldy+4,oldx)||sp1
end
if vak.k=0 then
sendstring apos(y,x)||b.1||apos(y+1,x)||b.2||sp2||b.2||apos(y+2,x)||b.3||sp2||b.3||apos(y+3,x)||b.4||sp2||b.4||apos(y+4,x)||b.5
else;do
i=vak.k
sendstring apos(y,x)||b.1||apos(y+1,x)||b.2||apos(y+1,x+10)||b.2||apos(y+2,x)||b.3||apos(y+2,x+10)||b.3||apos(y+3,x)||b.4||apos(y+3,x+10)||b.4||apos(y+4,x)||b.5
end
sendstring apos(24,79)
end
else niets=0
if tel=6|quit=1 then return
end
win_or_lose:
if quit=0&chang=0 then;do
i=vak.k
sendstring '
'||apos(oldy,oldx)||sp1||apos(oldy+1,oldx)||' '||s.i.1||'
'||apos(oldy+2,oldx)||' '||s.i.2||'
'||apos(oldy+3,oldx)||' '||s.i.3||'
'||apos(oldy+4,oldx)||sp1
call clr(25)
select
when gametype='1' then;do
if win=1 then;do
getuser 7
tijd=result
setobject tijd+(gain*inzet)
putuser 7
sendstring apos(25,26)||'\q1\k1C O N G R A T U L A T I O N S !!!\k0'
sendstring apos(26,23)||'\k1Y O U H A V E W O N '||gain*inzet||' M I N U T E S\k0'
sendstring apos(27,30)||'\k1 E X T R A T I M E !!!\k0'
end
else;do
getuser 7
tijd=result
setobject tijd-inzet
putuser 7
if inzet=1 then eenh=' M I N U T E'
else eenh=' M I N U T E S'
sendstring apos(26,19)||'\q1\c7Y O U H A V E L O S T '||inzet||eenh||' !!!'
end
end
when gametype='2' then;do
if win=1 then;do
getuser 42
setobject result+(gain*inzet)
putuser 42
sendstring apos(25,26)||'\q1\k1C O N G R A T U L A T I O N S !!!\k0'
sendstring apos(26,30)||'\k1Y O U H A V E W O N '||gain*inzet||'\k0'
sendstring apos(27,28)||'\k1 B Y T E C R E D I T S !!!\k0'
end
else;do
getuser 42
setobject result-inzet
putuser 42
if inzet=1 then eenh=' C R E D I T'
else eenh=' C R E D I T S'
sendstring apos(26,15)||'\q1\c7Y O U H A V E L O S T '||inzet||' B Y T E'||eenh||' !!!'
end
end
when gametype='3' then;do
if win=1 then;do
getuser 43
setobject result+(gain*inzet)
putuser 43
sendstring apos(25,26)||'\q1\k1C O N G R A T U L A T I O N S !!!\k0'
sendstring apos(26,31)||'\k1Y O U H A V E W O N '||gain*inzet||'\k0'
sendstring apos(27,28)||'\k1 F I L E C R E D I T S !!!\k0'
end
else;do
getuser 43
setobject result-inzet
putuser 43
if inzet=1 then eenh=' C R E D I T'
else eenh=' C R E D I T S'
sendstring apos(26,15)||'\q1\c7Y O U H A V E L O S T '||inzet||' F I L E'||eenh||' !!!'
end
end
when gametype='4' then;do
if win=1 then;do
sendstring apos(26,26)||'\q1\k1C O N G R A T U L A T I O N S !!!\k0'
sendstring apos(27,30)||'\k1Y O U H A V E W O N !!!\k0'
end
else sendstring apos(26,28)||'\q1\c7Y O U H A V E L O S T !!!'
end
end
sendstring apos(29,34)||'\c4[\c3 PRESS A KEY \c4]\c0'
call check_carrier
getchar
if upper(result)='Q' then call exitscratche
if upper(result)='C' then call changegame
sendstring '\q1'
end
else if tel>1 then;do
if gametype~='4' then;do
getuser 7
tijd=result
setobject tijd-inzet
putuser 7
end
end
return
changegame:
err=0
do forever
call check_carrier
call clr(25)
sendstring apos(26,14)||'\c6Choose game-type (\c11\c6=Time, \c12\c6=Bytes, \c13\c6=Files, \c14\c6=Fun) : \c1'||apos(26,67)
prompt 1
gametype=upper(result)
select
when gametype='Q' then call exitscratche
when gametype='1' then;do
getuser 7
if result<5 then;do
sendstring apos(27,32)||'\c1Not enough time left!'
err=1
end
else return
end
when gametype='2' then;do
getuser 42
if result<5 then;do
sendstring apos(27,28)||'\c1Not enough byte credits left!'
err=1
end
else return
end
when gametype='3' then;do
getuser 43
if result<5 then;do
sendstring apos(27,28)||'\c1Not enough file credits left!'
err=1
end
else return
end
when gametype='4' then return
otherwise nop
end
if err=1 then;do
sendstring apos(29,34)||'\c4[\c3 PRESS A KEY \c4]\c0'
call check_carrier
getchar
if upper(result)='Q' then call exitscratche
sendstring '\q1'
err=0
end
end
return
exitscratche:
sendstring '\f1\n3\z0\'
getuser 7
stoptijd=result
delta=stoptijd-starttijd
if delta=1| delta=-1 then eenh='minute'
else eenh='minutes'
if delta>=0 then
sendstring '\k1'||center('You have won '||delta||' '||eenh||'!',78)||'\k0\n2'
else sendstring '\c7'||center('You have lost '||-delta||' '||eenh||'!',78)||'\k0\n2'
getuser 42
stopbyte=result
delta=stopbyte-startbyte
if delta=1| delta=-1 then eenh='credit'
else eenh='credits'
if delta>=0 then
sendstring '\k1'||center('You have won '||delta||' byte '||eenh||'!',78)||'\k0\n2'
else sendstring '\c7'||center('You have lost '||-delta||' byte '||eenh||'!',78)||'\k0\n2'
getuser 43
stopfile=result
delta=stopfile-startfile
if delta=1| delta=-1 then eenh='credit'
else eenh='credits'
if delta>=0 then
sendstring '\k1'||center('You have won '||delta||' file '||eenh||'!',78)||'\k0\n3\c3'
else sendstring '\c7'||center('You have lost '||-delta||' file '||eenh||'!',78)||'\k0\n3\c3'
sendstring center('ScratchE! V1.1 by Morpheus',78)||'\c2'
sendstring apos(2,16)'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»'
sendstring apos(3,16)'º'apos(3,63)'º'apos(4,16)'º'apos(4,63)'º'apos(5,16)'º'apos(5,63)'º'apos(6,16)'º'apos(6,63)'º'apos(7,16)'º'apos(7,63)'º'apos(8,16)'º'apos(8,63)'º'apos(9,16)'º'apos(9,63)'º'
sendstring apos(10,16)'ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹'
sendstring apos(11,16)'º'apos(11,63)'º'
sendstring apos(12,16)'ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\c1\n2'
sendstring center('Returning to '||bbsname||'...',78)||'\n1\w3\q1'
setlength maxlines
exit
apos:
return ''arg(1)';'arg(2)'H'
printheader:
sendstring '\f1\@6\c6'
sendstring center('ÛßßßßßÛ ÛßßßßßÛ ÛßßßßßßÛ ÛßßßßßßÛ ÛßßßßßÛ ÛßßßßßÛ ÛßÛ ÛßÛ ÛßßßßßÛ ÛßÛ',80)||'\n1'
sendstring center('Û Ûßßßß Û ÛßÛ Û Û ÛßßÛ Û Û ÛßßÛ Û ßßÛ Ûßß Û ÛßÛ Û Û Û Û Û Û Ûßßßß Û Û',80)||'\n1'
sendstring center('Û ßßßßÛ Û Û ßßß Û ßßßß Û Û ßßßß Û Û Û Û Û ßßß Û ßßß Û Û ßßÛ Û Û',80)||'\n1'
sendstring center('ßßßßÛ Û Û Û ÛßÛ Û ÛßÛ Ûß Û ÛßßÛ Û Û Û Û Û ÛßÛ Û ÛßÛ Û Û Ûßß ßßß',80)||'\n1'
sendstring center('Ûßßßß Û Û ßßß Û Û Û Û ßÛ Û Û Û Û Û Û Û ßßß Û Û Û Û Û Û ßßßßÛ ÛßÛ',80)||'\n1'
sendstring center('ßßßßßßß ßßßßßßß ßßß ßßßß ßßß ßßß ßßß ßßßßßßß ßßß ßßß ßßßßßßß ßßß',80)||'\n1'
sendstring apos(7,23)||'\c4-=> \c3ScratchE! V1.1 by Morpheus \c4<=-'
return
instr:
call printheader
sendstring '\n2\c3 ScratchE! is a very simple doorgame especially written for Excelsior! BBS.\n1'
sendstring ' The aim of the game is to find at least three equal symbols/numbers in a\n1'
sendstring ' six-field scratch-ticket.\n2'
sendstring ' There are four different game-types:\n2'
sendstring ' \c41)\c3 Time - Play for extra time\n1'
sendstring ' \c42)\c3 Bytes - Play for extra download bytes\n1'
sendstring ' \c43)\c3 Files - Play for extra download files\n1'
sendstring ' \c44)\c3 Fun - Play for fun !!!\n2'
sendstring ' At the start of each game of the first 3 game-types you re asked to place a\n1'
sendstring ' bet. If you lose the game then the stake will be subtracted from your\n1'
sendstring ' balance. If you win the game then '||gain||' times the stake will be added to your\n1'
sendstring ' balance.\n1'
sendstring ' If you quit the game with more than one field scratched open, you''ll lose!\n1'
return
rnd:
return (random(1,100,time(s))+random(1,100,time(s))+random(1,100,time(s)))//arg(1)
clr:
sendstring ''arg(1)'H'
return
check_carrier:
getcarrier
if result='FALSE' then exit
return